/**
 * 
 */
package view;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import common.DataManager;
import controller.Controller;

/**
 * @author Bill
 * 
 * This panel is shown on the cargo panel, and there is one for every available
 * cargo item. 
 *
 */
public class CargoItemPanel extends ItemIconPanel implements MouseListener{
	
	private static final long serialVersionUID = 1L;
	private String weaponName;

	/**
	 * Constructs a Icon with a white background and a image on top of the background,
	 * as specified by fileName.
	 * 
	 * @param fileName
	 */
	public CargoItemPanel(String fileName) {
		super(fileName);
		this.weaponName = fileName;
		addMouseListener(this);
	}
	
	public CargoItemPanel(String fileName, String bottomLabel) {
		super(fileName, bottomLabel);
		this.weaponName = fileName;
		addMouseListener(this);
	}
	
	public String getItemName(){
		return weaponName;
	}
	
	/**
	 * Mouse click is handled in the Controller class
	 */
	@Override
	public void mouseClicked(MouseEvent e) {
		Controller.cargoItemSelected(this);
		System.out.println(weaponName+" was chosen in cargo");
	}

	@Override
	public void mouseEntered(MouseEvent e) {
	}

	@Override
	public void mouseExited(MouseEvent e) {
	}

	@Override
	public void mousePressed(MouseEvent e) {
	}

	@Override
	public void mouseReleased(MouseEvent e) {
	}

}
